﻿#pragma once
#include "labelUi.hpp"


class ImgUi : public LabelUiBase
{
	DECLARE_DYNAMIC(ImgUi)

public:
	ImgUi(LabelUiBase* pParentDdfwUi, OssJson& createInfo);
	virtual ~ImgUi();

protected:
	DECLARE_MESSAGE_MAP()

	
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnPaint();
	afx_msg LRESULT OnShowImg(WPARAM wparam, LPARAM lparam);
	afx_msg LRESULT OnRepaint(WPARAM wparam, LPARAM lparam);

	BOOL CreateBitmap(int iWidth,int iHeight,int iPlanes,int iBpp);

	/**
	 *      更新UI
	 */
	virtual void UpdateUi(OssJson& updateUiInfo) override;


private:
	HBITMAP m_hBmp = nullptr;
	BITMAPINFO m_bi;
	BYTE*	m_pbyBitmatData;
	int		m_iBitmatDataMax;
	DWORD		m_dwLastUpdate = 0;
};


